def spiral(size):
	rings = int((size+1)/2)
	sum = 1
	last = 1
	for x in range(1,rings):
		for y in range(4):
			last = last + 2*x
			sum = sum + last
	return sum

print(spiral(1001))